﻿namespace PengSW.SqlServerTools
{
    public class ColumnType
    {
        private ColumnType(string aTypeName, bool aHasSize, bool aCouldBeIdentity)
        {
            TypeName = aTypeName;
            HasSize = aHasSize;
            CouldBeIdentity = aCouldBeIdentity;
        }

        public string TypeName { get; private set; }
        public bool HasSize { get; private set; }
        public bool CouldBeIdentity { get; private set; }

        /// <summary>
        /// 可用的数据类型列表
        /// </summary>
        public static ColumnType[] ColumnTypes = new ColumnType[] 
        {
            new ColumnType("nvarchar", true, false),
            new ColumnType("int", false, true),
            new ColumnType("bool", false, false),
        };

        public static ColumnType StringType { get { return ColumnTypes[0]; } }
        public static ColumnType IntType { get { return ColumnTypes[1]; } }
        public static ColumnType BoolType { get { return ColumnTypes[2]; } }
    }
}
